#ifndef TWTANKERWIDGET_H
#define TWTANKERWIDGET_H

#include <QWidget>
#include <QLabel>
#include <QMap>
#include <QString>
#include "BtWidget_global.h"

namespace Ui {
class TwTankerWidget;
}

class BTWIDGET_EXPORT TwTankerWidget : public QWidget
{
    Q_OBJECT

public:
    explicit TwTankerWidget(QWidget *parent = nullptr);
    ~TwTankerWidget();

    //加油枪的实时状态
    enum eGunRtState{
        GUN_OFFLINE = 1,
        GUN_ONLINE,
        GUN_FUELING,
        GUN_PREWARNING,
        GUN_WARNING
    };

    void setTankerNo(int iTankerNo);
    int getTankerNo() const;

    void addGun(int index, int iGunIdx, int iState=0);
    void setOilState(int index, int iState);

private:
    Ui::TwTankerWidget *ui;

    QMap<int, QLabel*> mapGunNo;
    QMap<int, QLabel*> mapOilState;

    int m_iTankerNo;

    //初始化控件数组
    void initGunGroup();

    void setGunVisable(int index,bool bState);
    void setGunTitle(int index, int iGunIdx);

    void paintEvent(QPaintEvent *event);
};

#endif // TWTANKERWIDGET_H
